import QtQuick 2.6
import QtQuick.Layouts 1.2

import "../../Base/UiBase"
import "../../Base/Config"

Item {
    ColumnLayout {
        anchors.fill: parent
        Header {
            id: header
            Layout.fillWidth: true
        }
        ListModel {
            id: listmodel
            ListElement {
                head: "../../../resources/tests/Beautiful Notebook.PNG"
                name: "HappyZh"
            }
            ListElement {
                head: "../../../resources/tests/69b7d63agw1ex95lh4eatj20c80godhc.jpg"
                name: "abcd"
            }
            ListElement {
                head: "../../../resources/tests/Beautiful Notebook.PNG"
                name: "Happy0403"
            }
        }

        Item {
            Layout.fillWidth: true
            Layout.fillHeight: true
            z: -1
            ListView {
                id: listview
                anchors.fill: parent
                spacing: 0

                delegate: Rectangle {
                    width: parent.width
                    height: 100 * Size.ratio
                    color: Color.foreground
                    RowLayout {
                        anchors.fill: parent
                        spacing: 20 * Size.ratio
                        Item {
                            Layout.fillHeight: true
                            Layout.preferredWidth: height
                            HeadHolder {
                                anchors.centerIn: parent
                                SvgzImage {
                                    width: 80 * Size.ratio
                                    height: 80 * Size.ratio
                                    source: model.head
                                }
                            }
                        }
                        Text {
                            Layout.fillWidth: true
                            Layout.fillHeight: true
                            verticalAlignment: Text.AlignVCenter
                            text: model.name
                            font.pixelSize: Size.font26
                            color: Color.input
                        }
                    }
                    BottomDivider{}
                }

                model:listmodel
            }
        }
    }
}
